package org.hrqing.authorization.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hrqing.authorization.entity.mapper.BaseAuditingEntity;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @auther Hrqing
 */
@Getter
@Setter
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "t_user")
public class User extends BaseAuditingEntity {

    @Column(nullable = false, unique = true)
    private String username;

    private String password;

    private String name;

    @Column(nullable = false, unique = true)
    private String certNumber;

    @Column(nullable = false, unique = true)
    private String mobile;

    private boolean enabled = true;

}
